//
//  DCAvchatManager.h
//  DCAvchatSDK
//
//  Created by zhangtao on 2020/9/18.
//  Copyright © 2020 zhangtao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <DCAvchatKit/AvchatKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface DCAvchatManager : NSObject

@property(nonatomic,strong) AvchatKit *avchatKit;

//初始化音视频
- (void) initWithServiceUrl:(NSString*) url;
//登录
- (void) login:(NSDictionary*)loginInfo callback:(nullable void (^)(DCError *error,NSDictionary *data))callback;
//注销
- (void) logout;
//呼叫
- (void) call:(NSDictionary*)callInfo callback:(nullable void (^)(DCError *error,NSDictionary *data))callback;
//接听
- (void) answer:(nullable void (^)(DCError *error,NSDictionary *data))callback;
//拒绝(未接通前)
- (void) refuse:(nullable void (^)(DCError *error,NSDictionary *data))callback;
//挂断(接通状态)
- (void) hangUp:(nullable void (^)(DCError *error,NSDictionary *data))callback;
//添加通话邀请监听
- (void) addCallInvitationDelegate:(id<DCAvchatCallInvitationDelegate>)delegate;
//移除通话邀请监听
- (void) removeCallInvitationDelegate;
//取消(未接通前)
- (void) cancel:(nullable void (^)(DCError *error,NSDictionary *data))callback;
//添加对方取消/拒绝/繁忙消息监听
- (void) addCalleeStateDelegate:(id<DCAvchatCalleeStateDelegate>)delegate;
//移除对方取消/拒绝/繁忙消息监听
- (void) removeCalleeStateDelegate;
//添加当前通话信息监听
- (void) addCallStateDelegate:(id<DCAvchatCallStateDelegate>)delegate;
//移除当前通话信息监听
- (void) removeCallStateDelegate;
//切换音视频通话
- (void) switchAVControl:(DCAvchatNetCallMediaType)type;
//添加音视频控制监听
- (void) addCallControlDelegate:(id<DCAvchatCallControlDelegate>)delegate;
//移除音视频控制监听
- (void) removeCallControlDelegate;
//添加投屏监听
- (void) addSendScreenDelegate:(id<DCAvchatSendScreenDelegate>)delegate;
//移除投屏监听
- (void) removeSendScreenDelegate;
//投屏
- (void) sendScreen;
//取消投屏
- (void) cancelSendScreen;
//投屏状态
- (BOOL) isSendScreen;
//用户同意投屏给坐席
- (void) agreeSendScreen;
//用户拒绝投屏给坐席
- (void) refuseSendScreen;
//切换摄像头
- (void) switchCamera;
//打开/关闭摄像头
- (void) toggleCamera:(BOOL)status;
//摄像头状态
- (BOOL) cameraStatus;
//设置静音
- (void) toggleMute:(BOOL)isMute;
//静音状态
- (BOOL) isMute;
//打开/关闭麦克风
- (void) toggleSpeaker:(BOOL)useSpeaker;
//麦克风状态
- (BOOL) isSpeaker;
//暂停通话
- (void) togglePauseSession:(BOOL)isPause;
//是否暂停通话状态
- (BOOL) isPauseSession;
//探测网络视频通话质量
- (void) detectNetwork:(int)type callback:(nullable void (^)(DCError *error,NSDictionary *data))callback;
//停止探测
- (void) stopDetectTask:(int)taskId;
//本地视频截图
- (void) takeSnapshot:(void(^)(UIImage * __nullable image))callback;


@end

NS_ASSUME_NONNULL_END
